#pragma once

#include "includeBase.h"
#include "pcl/includePcl.h"

#include "../common/BasePclModel.h"
#include <pcl/range_image/range_image.h>

class NARFModel : public BasePclModel
{
public:
    NARFModel();

public:
    static NARFModel& get();

public: // IJsonSerializable
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    QJsonObject toJson() const override;

public: // Property
    QString pcdFile() const { return pcdFile_; }
    void setPcdFile(const QString& pcdFile) { pcdFile_ = pcdFile; }

    QString farRangesPcdFile() const { return farRangesPcdFile_; }
    void setFarRangesPcdFile(const QString& far_ranges_pcd_file) { farRangesPcdFile_ = far_ranges_pcd_file; }

    float angularResolution() const { return angularResolution_; }
    void setAngularResolution(float angular_resolution) { angularResolution_ = angular_resolution; }

    float supportSize() const { return supportSize_; }
    void setSupportSize(float support_size) { supportSize_ = support_size; }

    pcl::RangeImage::CoordinateFrame coordinateFrame() const { return coordinateFrame_; }
    void setCoordinateFrame(pcl::RangeImage::CoordinateFrame coordinate_frame) { coordinateFrame_ = coordinate_frame; }

    bool setUnseenToMaxRange() const { return setUnseenToMaxRange_; }
    void setSetUnseenToMaxRange(bool setUnseenToMaxRange) { setUnseenToMaxRange_ = setUnseenToMaxRange; }

    bool rotationInvariant() const { return rotationInvariant_; }
    void setRotationInvariant(bool rotation_invariant) { rotationInvariant_ = rotation_invariant; }

private:
    QString pcdFile_ = "<pcl-data>/tutorials/table_scene_mug_stereo_textured.pcd";
    QString farRangesPcdFile_ = "";

    float angularResolution_ = 0.5f;
    float supportSize_ = 0.2f;
    pcl::RangeImage::CoordinateFrame coordinateFrame_ = pcl::RangeImage::CAMERA_FRAME;
    bool setUnseenToMaxRange_ = false;
    bool rotationInvariant_ = true;
};
